﻿using ByHand.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ByHand.Services.Code
{
    public enum ELogActionType
    {
        ByHand_Click = 0,
        Link_Click = 1,
        Button_Html_Click = 2,
        Button_Frame_Click = 3,
        Button_Widget_Click = 4,
        Button_Widget_ViewMore_Click = 5,
        Create_New_Order = 6,
        Edit_Order = 7,
        Checkout_Order = 8,
        Pay_Success = 9,
        Pay_Failed = 10,
        Admin_Update = 11
    }
    public enum ELogActionDetail
    {
        None = 0,
        CheckOut_Soha = 1,
        CheckOut_COD = 2,
        CheckOut_Bank = 3,
        Payment_Soha_Visa = 4,
        Payment_Soha_MasterCard = 5,
        Payment_COD = 6,
        Payment_Bank = 7,
        Soha_Failed_BySoha = 8,
        Soha_Failed_WrongInfo = 9,
        Update_Status = 10,
        Update_Information =11
    }
    public class LogHelpers
    {
        public static ELogActionDetail ConvertPaytype(EPayType paytype)
        {
            switch (paytype)
            {
                case EPayType.SoHaPay: return ELogActionDetail.CheckOut_Soha;
                case EPayType.COD: return ELogActionDetail.CheckOut_COD;
                case EPayType.BankTransfer: return ELogActionDetail.CheckOut_Bank;
                default: return ELogActionDetail.None;
            }
        }
    }
}
